package myGrid;
import java.util.ArrayList;
import java.util.List;

import org.testng.TestNG;
import org.testng.annotations.Test;
import org.testng.xml.XmlClass;
import org.testng.xml.XmlSuite;
import org.testng.xml.XmlTest;


public class parallelRunner2 {
	
	@Test
	public void myTest1() throws InterruptedException{
		XmlSuite suite = new XmlSuite();
		suite.setName("Paralle GRID Run through Java Class - RUN 1");
		suite.setParallel("tests");
		suite.setThreadCount(5);
		 
		XmlTest test1 = new XmlTest(suite);
		test1.setName("FF1");
		List<XmlClass> class1 = new ArrayList<XmlClass>();
		class1.add(new XmlClass("myGrid.YT1"));
		test1.setXmlClasses(class1) ;

		XmlTest test2 = new XmlTest(suite);
		test2.setName("IE2");
		List<XmlClass> class2 = new ArrayList<XmlClass>();
		class2.add(new XmlClass("myGrid.YT2"));
		test2.setXmlClasses(class2) ;

		XmlTest test3 = new XmlTest(suite);
		test3.setName("IE3");
		List<XmlClass> class3 = new ArrayList<XmlClass>();
		class3.add(new XmlClass("myGrid.YT3"));
		test3.setXmlClasses(class3) ;

		
		List<XmlSuite> suites = new ArrayList<XmlSuite>();
		suites.add(suite);
		TestNG tng = new TestNG();
		tng.setXmlSuites(suites);
		tng.run(); 
	}
}
